<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
    <div contenteditable="false" @click="find">find函数</div>
    <el-upload
            class="upload-demo"
            action=""
            :multiple="false"
            :show-file-list="false"
            :http-request="directImport"
    >
        <el-button size="small" type="primary">点击上传</el-button>
        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
</div>
</body>
</html>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!',
            fileList: []
        },
        methods: {
            handleChange(file, fileList) {
                this.fileList = fileList.slice(-3);
                console.log(this.fileList)
            },
            directImport(res) {
                const list = []
                const object = {}
                list.push(object)
                console.log(res)
            },
            find() {
                console.log(1)
                const list = [
                    {label: '微信', value: '1'},
                    {label: '支付宝', value: '2'},
                    {label: '现金', value: '3'},
                    {label: '银行卡', value: '4'},
                    {label: '余额', value: '5'},
                ]
                console.log(list.find(item => item.value === '1'))
            }
        }
    })
</script>
